<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body ng-app="myApp">
    <div ng-controller="myCtrl">
        账号：<input type="text"  ng-model="account" required=""><br>
        密码：<input type="text"  ng-model="pwd" required=""><br>
        <button ng-click="login()">登录</button>
        <div ng-if="error.length>1" ng-bind="error"></div>
        <div ng-bind="test"></div>
    </div>
</body>
<script src="angular.min.js"></script>
<script type="text/javascript">
    var app = angular.module("myApp",[]);
    app.controller("myCtrl",function($scope){
        $scope.account = ""
        $scope.pwd = ""
        $scope.error = ""
        $scope.login = function(){
            if($scope.account=="admin"&&$scope.pwd=="123"){
                $scope.error = "";
                alert("登陆成功");
            }else{
                $scope.error = "账号或密码错误";
            }
        }
    })
</script>
</html>